/*
============================================================================
 Name        : BlockBengBeng.h
 Author      : 
 Version     :
 Copyright   : 
 Description : CBlockBengBeng declaration
============================================================================
*/

#ifndef BlockBengBeng_H
#define BlockBengBeng_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <badesca.h>
#include "Block.h"
#include "ThreadSocket.h"
#include <BITSTD.H>
// CLASS DECLARATION
class CPeriodic;
class CBengBengDbMgr;
class MOpenStatusObserver;

/**
*  CBlockBengBeng
* 
*/
class CBlockBengBeng : public CBlock
{
public:
	~CBlockBengBeng();

	static CBlockBengBeng* NewL();

	static CBlockBengBeng* NewLC();
	
public:
	//from CBlock
	TInt GetDataLength();

	TInt16 GetDataType();

	TBool ReadData(const TDesC8& aData);

	void WriteData(TDes8& aBuf);

	void StopSocket();
	
	void OnDraw(CWindowGc& gc);

	void OnKeyEvent(TInt keyCode);

	void SizeChanged();

	void SetOpenStatusObserver(MOpenStatusObserver* aObserver);
	
	virtual void OnMouseDown(const TPoint& aPt);

	virtual void OnMouseUp(const TPoint& aPt);

private:
	void SaveBengBengMessage(TInt32 aTime, const TDesC& aTitle, const TDesC& aDetailText);
	
	void Transparent();

private:
	CBlockBengBeng();

	void ConstructL();

public:
	TBool m_bShowMainInfo;
	HBufC* m_strMainInfoTitle;
	HBufC* m_strMainInfoText;
	TInt32 m_nMainInfoGoodsID;

private:
	TInt32 s_nInfoTime;
	TBool m_bExit;
	CDesCArray* m_vMainInfoTitle;	
	CDesCArray* m_vMainInfoText;
	CBengBengDbMgr* iBengBengDbMgr;
	MOpenStatusObserver* iOpenStatusObserver;
	
	
	CFbsBitmap* iCheck;
	CFbsBitmap* iCheck_MM;
	CFbsBitmapDevice* iOffScreenBitmapDevice;
	CFbsBitGc* iOffScreenBitmapGc;
	
	mutable TRect iLeftButtonRect;
	mutable TRect iRightButtonRect;
	TBool iLeftButtonPress;
	TBool iRightButtonPress;
};

#endif // BlockBengBeng_H
